package com.eg;/** * @email 99723251@qq.com * @author: zhangyangtao * @date: 2019/6/12 * @time: 11:01 PM */public class StaticInner {    /**     * 静态内部类     */    public static StaticInner getInstance() {        return StaticInnerV1.staticInner;    }    //继承懒汉式的优点，不调用不会加载    private static class StaticInnerV1 {        //static 只加载一次，线程安全        private static final StaticInner staticInner = new StaticInner();    }    public static void main(String[] args) {        System.out.println("程序启动");        StaticInner instance = StaticInner.getInstance();        StaticInner instance1 = StaticInner.getInstance();        System.out.println(instance==instance1);    }}